package easy;
/*
278. 第一个错误的版本
解题思路：二分查找算法
 */
public class LeeCode278 {

  public static void main(String[] args) {

  }

  public int firstBadVersion(int n) {
    int l = 0;
    int r = n;
    while (l < r){
      int mid = l + (r - l) / 2;;
      if (isBadVersion(mid)){
        r = mid;
      }else {
        l = mid +1;
      }
    }
    return l;
  }

  public boolean isBadVersion(int num){
    return true;
  }
}
